package cn.wxManage.user.controller;

import cn.common.common.model.ServerResponse;
import cn.wxManage.user.service.IWXUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Zhang on 2018/11/29.
 */
@RestController
@RequestMapping("/wxUser")
@Api(value = "微信服务器用户数据校验获取", description = "微信服务器用户数据校验获取")
public class WXUserController {

    @Autowired
    IWXUserService iwxUserService;

    @ApiOperation(value="根据code获取登陆微信用户详细信息", notes="根据code获取登陆微信用户详细信息",produces = "application/json")
    @ApiImplicitParam(name = "code", value = "微信用户临时令牌",paramType ="query",dataType = "String")
    @GetMapping(value = "/getWXUserInfo")
    public ServerResponse<?> getWXUserInfo(@RequestParam("code") String code){
        return iwxUserService.getWXUserInfo(code);
    }
}
